import { h, Component } from 'preact';
import classNames from 'classnames';

class Card extends Component {
	constructor(props) {
		super(props);
		this.state = {

		};
	}

	componentDidMount() {

	}

	render({ title,footer,header,subTitle,children,className,id,...other }) {
		return (
			<div id={id} class={classNames('card',className)}>
				{/* <img class="card-img-top" src="..." alt="Card image cap"> */}
				{header&&<div class="card-header">{header}</div>}
				<div class="card-body">
					{ title&&<h5 class="card-title">{title}</h5>}
					{ subTitle&&<h6 class="card-subtitle mb-2 text-muted">{subTitle}</h6>}
					{children}
				</div>
				{footer&&<div class="card-footer text-muted">{footer}</div>}
			</div>
		);
	}
}

Card.Link = ({ children,className, ...other }) => <a href="#" class={classNames('card-link',className)} {...other}>{children}</a>;

Card.propTypes = {

};

Card.defaultProps ={

}

export default Card;
